﻿using LJ.EventBus.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LJ.EventBus.HornedSerpent.Transport.Abstractions;

public class EventBusTransportData(IDictionary<string, string?> headers, ReadOnlyMemory<byte> body)
{
    public IDictionary<string, string?> Headers { get; } = headers ?? throw new ArgumentNullException(nameof(headers));

    public ReadOnlyMemory<byte> Body { get; } = body;

    public string GetId()
    {
        return Headers[EventBusHeaders.MessageId]!;
    }

    public string GetName()
    {
        return Headers[EventBusHeaders.MessageName]!;
    }
}
